/* 
 * File:   Library.h
 * Author: Lucky
 *
 * Created on 22. září 2011, 10:33
 */

#ifndef LIBRARY_H
#define	LIBRARY_H



#include "Coordinate.h"
#include "Field.h"
#include "Chessboard.h"
using namespace std;

class Library {
public:
    Library();
    Library(const Library& orig);
    virtual ~Library();
    static int* LoadDataFromFile(char * fileName, int * width, int * height, int *q);
    static int LoadInt(const char* string, int min, int max);
    static int * LoadCoordinates(int count, int m, int n);
    static void getNextCoordinate(int m_x, int m_y, int width, int * r_x, int * r_y);
    static int getCoordLength(int width, int m_x, int m_y);
    static int getXCoord(int width, int fieldNumber);
    static int getYCoord(int width, int fieldNumber);
    static bool cutStack(Field* source, Field* dest);
    static void packStack(Field* sendedStack, char** buffer, int* packSize);
    static void unpackStack(Field** stack, char* buffer, int packSize, int length);
    static void sendStack(Field* stack, int destP);
    static void sendNoWork(int destP);
    static bool receiveStack(int sourceP, Field** field, int stackLength);
    static void clickChessboard(Chessboard* board, Field* field);

    //  static void DestroyCoordinates(Coordinate** coords, int count);
private:

};

#endif	/* LIBRARY_H */

